﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SHKF.B2C.WanLiNiu.Model.Inter.GoodsAdd;
using SHKF.B2C.WanLiNiu.Network;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SHKF.B2C.WanLiNiu.Service.Controllers
{
    [Route("[controller]")]
    [ApiController]
    public class ProductController : ControllerBase
    {
        private readonly HttpClientWLN httpClient;

        public ProductController(HttpClientWLN httpClient)
        {
            this.httpClient = httpClient;
        }

        [HttpPost("add")]
        public async Task<GoodDto> Add(GoodAddParam data)
        {
            GoodDto dto = await this.httpClient.GoodAdd(data);

            return dto;
        }

        [HttpPost("update")]
        public async Task<GoodDto> update(GoodUpdateParam data)
        {
            GoodDto dto = await this.httpClient.GoodUpdate(data);

            return dto;
        }

       
    }
}
